<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加产品信息</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/form.css"/>
		<link rel="stylesheet" type="text/css" href="../../js/layui-add-tree/css/layui-add-tree.css"/>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local"><span>位置：基础数据管理 > 产品信息管理 > 添加产品信息</span></p>
	            
			    	<div class="article_list" style="width: 98.5%; margin: 0px auto;">
			            <!------- 内容 ------->
			            <div class="content content1">
			                <!-- 用户列表内容区 -->
			                <div class="con con_01">
			                    <!-- 表单信息填写区 -->
			                    <h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>填写产品信息信息</span><span class="necessary">（带*号为必填项）</span></h4>
			                    <div class="write_area">
			                        <form id="addFrom" action="" method="post">
			                            <table class="contentText" border="1" cellspacing="0" cellpadding="0" width="99%">
			                                <tbody>
			                                    <tr>
			                                        <th>编号：</th>
			                                        <td>
			                                        	<input id="" name="" type="text" value="1004"> <span class="redColor">*</span>
			                                        </td>
			                                        <th>产品代号：</th>
			                                        <td>
			                                        	<input id="" name="" type="text" value=""> <span class="redColor">*</span>
			                                        </td>
													<th>产品名称：</th>
													<td>
														<input id="" name="" type="text" value=""> <span class="redColor">*</span>
													</td>
			                                        
			                                    </tr>
			                                    <tr>
													
			                                        <th>产品类型：</th>
			                                        <td>
			                                        	<select name="">
			                                        		<option value="1">产品类型一</option>
			                                        		<option value="2">产品类型二</option>
			                                        		<option value="3">产品类型三</option>
			                                        		
			                                        	</select>
			                                        </td>
			                                        <th>所属机构：</th>
			                                        <td>
			                                        	<label id = "fenchang"></label>
			                                        	<button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="openTree()">选择分厂</button>
														
														<span class="redColor">*</span>
			                                        </td>
			                                        <th></th>
			                                        <td>
			                                        	
			                                        </td>
			                                    </tr>
			                                    <tr>
			                                    	<th>备注：</th>
			                                        <td colspan="5">
			                                        	<textarea style="width: 95%;height: 100px;"> </textarea>
			                                        </td>			                                    	
			                                    </tr>
			                                    <tr style="display:none;">
			                                    	<th>创建人：</th>
			                                        <td>
			                                        	<input id="" name="creator" type="text" value=""> <span class="redColor">*</span>
			                                        </td>
			                                        <th>创建日期：</th>
			                                        <td>
			                                        	<input id="" name="createTime" type="text" value=""> <span class="redColor">*</span>
			                                        </td>
			                                        <th>修改人：</th>
			                                        <td>
			                                        	<input id="" name="modifier" type="text" value=""> <span class="redColor">*</span>
			                                        </td>
			                                        <th>修改日期：</th>
			                                        <td>
			                                        	<input id="" name="modifyTime" type="text" value=""> <span class="redColor">*</span>
			                                        </td>
			                                    	
			                                    </tr>
			                                </tbody>
			                            </table>
			                        </form>
			                        <!-- 保存、重置按钮区 -->
			                        <div align="center" class="btn_submit">
			                            <a href="productInfo.html" class="bgd_blue_two img_hand contentText">确定</a>
			                            <a href="productInfo.html" class="bgd_white_two img_hand"> 返回 </a>
			                        </div>
			                    </div>
			                </div>
			            </div>
			        </div>
				</div>
	            
			</div>
			<div class="content_wrap" hidden="hidden">
				<div id="test1" class="demo-tree demo-tree-box"></div>
			</div>
			<!-- 版尾  -->
			<div class="ending">
				 Copyright© 2019-2020 磐基技术有限公司
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/layui-add-tree/layui-add-tree.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$(".info_area td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");   
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");   
			}
		);
		
		function openTree(){
			var that = this; 
			  //多窗口模式，层叠置顶
			  layer.open({
				type: 1
				,area: ['400px', '300px']
				,shade: 0
				,content: $('.content_wrap')
				
			  });
			   
		}
		
		
		layui.use(['tree', 'util'], function(){
		  var tree = layui.tree
		  ,layer = layui.layer
		  ,util = layui.util
		  
		  //模拟数据1
		  ,data1 = [{
			title: '吉林江机特种工业有限公司'
			,id: 1
			,children: [{
			  title: '七分厂'
			  ,id: 1000
			  ,children: [{
				title: '电装车间'
				,id: 10001
			  }]
			},{
			  title: '二分厂'
			  ,id: 1001
			},{
			  title: '信息管理部'
			  ,id: 1002
			}]
		  }];
		  
		 
		  
		 
		  //常规用法
		  tree.render({
			elem: '#test1' //默认是点击节点可进行收缩
			,data: data1
			,onlyIconControl: true  //是否仅允许节点左侧图标控制展开收缩
			,click: function(obj){
				//alert(JSON.stringify(obj.data.title));
				$("#fenchang").html(JSON.stringify(obj.data.title));
				layer.closeAll();
			}
		  });
		  
		 
		});
		
	</script>
</html>
